

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    broswer = p.chromium.launch(headless=False)
    page = broswer.new_page()
    page.goto("http://www.baidu.com")
    # input_loc = page.locator("input[name='wd']")
    # input_loc.fill('python')
    # input_loc.clear()
    # page.fill('input[name="wd"]', 'python')
    page.locator("#s-usersetting-top").hover()
    page.wait_for_timeout(1000)
    page.locator('//span[text()="高级搜索"]').click()

    page.wait_for_timeout(5000)